using Decal.Adapter;
using Decal.Adapter.Wrappers;
using System;
using System.Collections.Generic;
using System.Text;

namespace SixthSense
{
    public partial class PluginCore
    {
        private void initChatEvents()
        {
            // Initialize incoming chat message event handler
            // Core.ChatBoxMessage += new EventHandler<Decal.Adapter.ChatTextInterceptEventArgs>(Core_ChatBoxMessage);

            // Initialize the outgoing chat/command message event handler
            // Core.CommandLineText += new EventHandler<Decal.Adapter.ChatParserInterceptEventArgs>(Core_CommandLineText);
        }

        void Core_CommandLineText(object sender, Decal.Adapter.ChatParserInterceptEventArgs e)
        {
            //TODO: outgoing chat handling code or command handling
        }

        void Core_ChatBoxMessage(object sender, Decal.Adapter.ChatTextInterceptEventArgs e)
        {
            //TODO: incoming chat handling code
        }
        private void destroyChatEvents()
        {
            // Core.ChatBoxMessage -= new EventHandler<Decal.Adapter.ChatTextInterceptEventArgs>(Core_ChatBoxMessage);
            // Core.CommandLineText -= new EventHandler<Decal.Adapter.ChatParserInterceptEventArgs>(Core_CommandLineText);
        }

        private void WriteToChat(string message)
        {
            WriteToChat("Sixth Sense: " + message , 3);
        }
        private void WriteToChat(string message, int MessageColor)
        {
            try
            {
                this.Host.Actions.AddChatText(message, MessageColor);
            }
            catch (Exception ex)
            {
                errorLogging.LogError(errorLogFile, ex);
            }
        }

        private void RawWriteToChat(string message, int MessageColor)
        {
            try
            {
                this.Host.Actions.AddChatTextRaw(message, MessageColor);
            }
            catch (Exception ex)
            {
                errorLogging.LogError(errorLogFile, ex);
            }
        }
    }
}